# Compiler and flags
CXX = g++
CXXFLAGS = -std=c++17 -Wall
LDFLAGS = -lboost_system -lpthread

# Target names
SERVER_TARGET = async_tcp_server
CLIENT_TARGET = async_tcp_client

# Source files
SERVER_SRC = async_tcp_server.cpp
CLIENT_SRC = async_tcp_client.cpp

# Default target
all: $(SERVER_TARGET) $(CLIENT_TARGET)

# Build the server
$(SERVER_TARGET): $(SERVER_SRC)
	$(CXX) $(CXXFLAGS) -o $@ $^ $(LDFLAGS)

# Build the client
$(CLIENT_TARGET): $(CLIENT_SRC)
	$(CXX) $(CXXFLAGS) -o $@ $^ $(LDFLAGS)

# Clean up
clean:
	rm -f $(SERVER_TARGET) $(CLIENT_TARGET)

.PHONY: all clean
